package com.zygh.interactiveplatform.module.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zygh.interactiveplatform.common.constant.EmployeeResponseCodeConst;
import com.zygh.interactiveplatform.common.domain.ResponseDTO;
import com.zygh.interactiveplatform.module.entity.Carstatistics;
import com.zygh.interactiveplatform.module.entity.StorageTrends;
import com.zygh.interactiveplatform.module.mapper.CarstatisticsMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lee
 * @since 2021-02-01
 */
@Service
public class CarstatisticsService extends ServiceImpl<CarstatisticsMapper, Carstatistics> {
    @Resource
    private CarstatisticsMapper carstatisticsMapper;

    public ResponseDTO findCarstatisticsLast(){
        Carstatistics carstatistics = carstatisticsMapper.findCarstatisticsLast();
        if (carstatistics != null) {
            return ResponseDTO.succData(carstatistics);
        }
        return ResponseDTO.wrap(EmployeeResponseCodeConst.EMPTY_INFORMATION_ERROR);
    }
}
